package org.moore.controller;

import org.moore.view.WelcomePanel;

import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
// 返回按钮监听类
public class BackButtonListener implements MouseListener {
    private final WelcomePanel welcomePanel;

    public BackButtonListener(WelcomePanel welcomePanel) {
        this.welcomePanel = welcomePanel;
    }

    // 返回至欢迎界面
    @Override
    public void mouseClicked(MouseEvent e) {
        WelcomePanel.getCardLayout().show(welcomePanel, "Welcome");
    }

    @Override
    public void mousePressed(MouseEvent e) {
    }

    @Override
    public void mouseReleased(MouseEvent e) {

    }

    @Override
    public void mouseEntered(MouseEvent e) {

    }

    @Override
    public void mouseExited(MouseEvent e) {

    }
}
